﻿using RpcCentral.Service.Interface;
using RpcCentral.Service.Model;
using RpcModel;

namespace RpcCentral.Service.TcpService
{
    internal class TcpAllot : SocketTcpServer.Interface.IAllot
    {
        public override object Action()
        {
            ITcpRoute route = TcpRouteService.GetRoute(this.Type);
            if(route == null)
            {
                return new BasicRes("rpc.direct.no.reg");
            }
            return route.TcpMsgEvent(new RemoteMsg(base.GetData(), base.ClientIp.Address.ToString())); ;
        }
    }
}
